package com.unicomcz.commision;

import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.List;

import com.unicomcz.DetailPageAction;

public class DetailKzczAction extends DetailPageAction
{
    private String curCommId;
    private String commRemarks;
    
    
    public String getCurCommId() {
        return curCommId;
    }

    public void setCurCommId(String curCommId) {
        this.curCommId = curCommId;
    }

    public String getCommRemarks() {
        return commRemarks;
    }

    public void setCommRemarks(String commRemarks) {
        this.commRemarks = commRemarks;
    }

    @Override
    public String getSqlStr() {
        String sql="select depart_code 代理商,comm_month 月份,depart_name 代理商名,callingnumber 空充号码,fullmoney 充值金额 "+
                " from dls_detail_kzcz"+
                " WHERE depart_code = ? AND comm_month=? ";
        return sql;
    }

    public Object[] getParams() {
        return new Object[]{userInfo.getDepartCode(),acctMonth};
    }
    protected void regQueryParam() throws Exception{
        if ((acctMonth==null)||(acctMonth.length()==0)) {
            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM");
            acctMonth=sf.format(new java.util.Date());
        }
        log.debug(acctMonth);
        log.debug(userInfo.getUserId());
        log.debug(curCommId);
        pstmt.setString(1, userInfo.getDepartCode());
        pstmt.setString(2, acctMonth);
    }
    protected void rs2List(ResultSet rs,List out) throws Exception{
        CommDetailBean t = new CommDetailBean();
        t.setDepartId(rs.getString(1));
        t.setAcctMonth(rs.getString(2));
        t.setBrand(rs.getString(3));
       // t.setBrandSub(rs.getString(4));
      //  t.setUserId(rs.getString(4));
        t.setSerialNumber(rs.getString(4));
       // t.setOpenTime(rs.getString(6));
     //  t.setCommId(rs.getString(7));
      //  t.setCommName(rs.getString(8));
      //  t.setCommRule(rs.getString(9));
    //    t.setProductId(rs.getString(10));
      //  t.setProductName(rs.getString(11));
    //    t.setStatus(rs.getString(12));
    //    t.setFlag3W(rs.getString(13));
     //   t.setGprs(rs.getString(14));
        //t.setHf(rs.getString(16));
        t.setYj(rs.getString(5));
      //  t.setOpenYcyf(rs.getString(16));
      //  t.setCommPer(rs.getString(17));
      //  t.setCommQishu(rs.getString(18));
        out.add(t);
    }

}
